﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Modules.franchise.data {
    import Classes.orders.*;
    import Modules.franchise.util.*;

    public class FranchiseExpansionData {

        private var m_franchiseType:String;
        private var m_locationUid:String;
        private var m_starRating:Number;
        private var m_commodityLeft:Number;
        private var m_commodityMax:Number;
        private var m_customersServed:Number;
        private var m_moneyCollected:Number;
        private var m_objectId:Number;
        private var m_timeLastCollected:Number;
        private var m_timeLastOperated:Number;
        private var m_timeLastSupplied:Number;

        public function FranchiseExpansionData(_arg1:String, _arg2:String, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number, _arg10:Number, _arg11:Number){
            this.m_franchiseType = _arg1;
            this.m_locationUid = _arg2;
            this.m_starRating = _arg3;
            this.m_commodityLeft = _arg4;
            this.m_commodityMax = _arg5;
            this.m_customersServed = _arg6;
            this.m_moneyCollected = _arg7;
            this.m_objectId = _arg8;
            this.m_timeLastCollected = _arg9;
            this.m_timeLastOperated = _arg10;
            this.m_timeLastSupplied = _arg11;
        }
        public static function loadObject(_arg1:Object):FranchiseExpansionData{
            return (loadObjectWithTypeAndLocation(null, null, _arg1));
        }
        public static function loadObjectWithTypeAndLocation(_arg1:String, _arg2:String, _arg3:Object):FranchiseExpansionData{
            var _local5:int;
            var _local6:Number;
            var _local7:Number;
            var _local8:Number;
            var _local9:Number;
            var _local10:Number;
            var _local11:Number;
            var _local12:Number;
            var _local13:Number;
            var _local14:Number;
            var _local4:FranchiseExpansionData;
            if (_arg3){
                _local5 = _arg3["star_rating"];
                _local6 = FranchiseUtil.formatServerStarRating(_local5);
                _local7 = _arg3["commodity_left"];
                _local8 = (_arg3.hasOwnProperty("commodity_max")) ? _arg3["commodity_max"] : 1;
                _local9 = _arg3["customers_served"];
                _local10 = _arg3["money_collected"];
                _local11 = _arg3["obj_id"];
                _local12 = (_arg3["time_last_collected"]) ? _arg3["time_last_collected"] : 0;
                _local13 = (_arg3["time_last_operated"]) ? _arg3["time_last_operated"] : 0;
                _local14 = (_arg3["time_last_supplied"]) ? _arg3["time_last_supplied"] : 0;
                _local4 = new FranchiseExpansionData(_arg1, _arg2, _local6, _local7, _local8, _local9, _local10, _local11, _local12, _local13, _local14);
            };
            return (_local4);
        }
        public static function loadDummyObject(_arg1:Number):FranchiseExpansionData{
            return (new FranchiseExpansionData(null, null, _arg1, 0, 0, 0, 0, 0, 0, 0, 0));
        }
        public static function loadPendingObject(_arg1:LotOrder):FranchiseExpansionData{
            var _local2:FranchiseExpansionData;
            if (_arg1){
                _local2 = new FranchiseExpansionData(_arg1.getResourceType(), _arg1.getRecipientID(), 0, 1, 0, 0, 0, 0, 0, 0, 0);
            };
            return (_local2);
        }
        public static function loadCitySamObject(_arg1:String, _arg2:int):FranchiseExpansionData{
            return (new FranchiseExpansionData(_arg1, _arg2.toString(), ((_arg2 % 5) + 1), 0, 1, 1337, 10000, 1, 0, 0, 1));
        }
        public static function loadFirstFranchiseOnCitySamMap(_arg1:String):FranchiseExpansionData{
            var _local2:Number = Math.floor((GlobalEngine.getTimer() / 1000));
            var _local3:FranchiseExpansionData = new FranchiseExpansionData(_arg1, "-1", 1, 0, 1, 0, 500, 0, _local2, _local2, 0);
            return (_local3);
        }

        public function get franchiseType():String{
            return (this.m_franchiseType);
        }
        public function get locationUid():String{
            return (this.m_locationUid);
        }
        public function get starRating():Number{
            return (this.m_starRating);
        }
        public function get commodityLeft():Number{
            return (this.m_commodityLeft);
        }
        public function get commodityMax():Number{
            return (this.m_commodityMax);
        }
        public function get customersServed():Number{
            return (this.m_customersServed);
        }
        public function get moneyCollected():Number{
            return (this.m_moneyCollected);
        }
        public function get objectId():Number{
            return (this.m_objectId);
        }
        public function get timeLastCollected():Number{
            return (this.m_timeLastCollected);
        }
        public function get timeLastOperated():Number{
            return (this.m_timeLastOperated);
        }
        public function get timeLastSupplied():Number{
            return (this.m_timeLastSupplied);
        }
        public function set timeLastSupplied(_arg1:Number):void{
            this.m_timeLastSupplied = _arg1;
        }
        public function isOpen():Boolean{
            return ((this.m_timeLastOperated > 0));
        }

    }
}//package Modules.franchise.data 
